package dao.impl;

import dao.MenuDao;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import pojo.menu;
import utils.JDBCUtils;

import java.util.List;
import java.util.Map;

public class MenuDaoImpl implements MenuDao {
    private JdbcTemplate jdbcTemplate = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<menu> findAllMenuList() {
        String sql = "select * from tab_menu ";
        List<menu> menuList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<menu>(menu.class));
        System.out.println(menuList);
        return menuList;
    }
}
